package webservice;

public class WebServiceServerProxy implements webservice.WebServiceServer {
  private String _endpoint = null;
  private webservice.WebServiceServer webServiceServer = null;
  
  public WebServiceServerProxy() {
    _initWebServiceServerProxy();
  }
  
  public WebServiceServerProxy(String endpoint) {
    _endpoint = endpoint;
    _initWebServiceServerProxy();
  }
  
  private void _initWebServiceServerProxy() {
    try {
      webServiceServer = (new webservice.WebServiceServerServiceLocator()).getWebServiceServer();
      if (webServiceServer != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)webServiceServer)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)webServiceServer)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (webServiceServer != null)
      ((javax.xml.rpc.Stub)webServiceServer)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public webservice.WebServiceServer getWebServiceServer() {
    if (webServiceServer == null)
      _initWebServiceServerProxy();
    return webServiceServer;
  }
  
  public void main(java.lang.String[] args) throws java.rmi.RemoteException{
    if (webServiceServer == null)
      _initWebServiceServerProxy();
    webServiceServer.main(args);
  }
  
  public java.lang.String helloWebService() throws java.rmi.RemoteException{
    if (webServiceServer == null)
      _initWebServiceServerProxy();
    return webServiceServer.helloWebService();
  }
  
  
}